#include "timer.h"

void timer0_init() {
	TMOD &= 0xF0;
	TMOD |= 0x01;
	TH0 = (65535-10000)/256;  //10ms
	TL0 = (65535-10000)%256;  //记得重新赋初值
	ET0 = 1;
	EA = 1;
	TR0 = 1;
}

void timer1_init() {
	TMOD &= 0x0F;
	TMOD |= 0x10;
	TH1 = (65535-10000)/256;  //10ms
	TL1 = (65535-10000)%256;
	ET1 = 1;
	EA = 1;
	TR1 = 1;
}

